package com.syg.camel;

import org.apache.camel.builder.RouteBuilder;

public class HelloWorld extends RouteBuilder {

    private static final String SOURCE_FOLDER = "src/test/source-folder";
    private static final String DESTINATION_FOLDER = "";

    /**
     * configure方法逻辑为：从源文件夹读文件，使用FileProcessor处理文件，然后发送结果值目标文件夹。delete=true是设置处理完成后删除源文件夹内容。
     * @throws Exception
     */
    @Override
    public void configure() throws Exception {
        from("file://" + SOURCE_FOLDER + "?delete=true").process(
                new FileProcessor()).to("file://" + DESTINATION_FOLDER);
    }
}
